from flask import jsonify
from backend.utils import read_json_file, json_to_dataframe


def get_all_data_api(app):
    @app.route('/api/movie/all_data')
    def get_all_data():
        input_file = '../output.json'
        json_data = read_json_file(input_file)
        df = json_to_dataframe(json_data)
        return jsonify(df.to_dict(orient='records'))
